package com.zhuoyue.biz.core.api.dto.req;

import lombok.Data;

import java.util.Map;

/**
 * @author Administrator
 */
@Data
public class CommonReq {
    private ControlReq controlParam;
    private String purpose;
    private String deviceId;

    /**
     * 控制方式
     *
     * @param deviceId
     * @param actions
     * @param controlType
     * @return
     */
    public static CommonReq controlBaseCmdReq(String deviceId, Map<String, Object> actions, String controlType) {
        CommonReq commonReq = new CommonReq();
        commonReq.setDeviceId(deviceId);
        commonReq.setPurpose("CONTROL");
        ControlReq controlReq = new ControlReq();
        controlReq.setActions(actions);
        controlReq.setControlType(controlType);
        commonReq.setControlParam(controlReq);
        return commonReq;
    }
}
